<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    // 字面量方法
    var arr = [1,2,3,4,5,6,7,8,9,10,20,30];

    // 转字符串方法
    // var str = arr.join("*");
    // var str = arr.join("");
    // console.log(str);

    // 清空数组
    // arr = [];
    // arr.length = 0;
    arr.splice(0,arr.length);
    console.log(arr);
    
  </script>
</head>
<body>
  
</body>
</html>